<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page session="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="/WEB-INF/jspf/links.jspf"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><spring:message code="company.login" /></title>
</head>
<body onload='document.singin.j_username.focus();'>
	<div id="wrapper">
		<!-- header -->
		<div id="header">
			<%@ include file="/WEB-INF/jspf/header.jspf"%>
		</div>

		<!-- top menu -->
		<div id="menu">
			<ul>
				<c:if test="${pageContext.response.locale == 'en'}">
					<li class="active"><a href="?lang=en"><c:out value="en" /></a></li>
					<li>|</li>
					<li><a href="?lang=ru"><c:out value="ru" /></a></li>
				</c:if>
				<c:if test="${pageContext.response.locale == 'ru'}">
					<li><a href="?lang=en"><c:out value="en" /></a></li>
					<li>|</li>
					<li class="active"><a href="?lang=ru"><c:out value="ru" /></a></li>
				</c:if>
			</ul>
			<span><a style="text-decoration: underline;"
				href="<c:url value="/pages/registration" />"><spring:message
						code="company.registration" /></a> </span>
		</div>

		<!-- bodywrap -->
		<div id="bodytop">&nbsp;</div>

		<div id="bodywrap">

			<div id="contentbody">
				<p>
					<spring:message code="company.login" />
				</p>
				<hr>
				<c:set
					var="errorMessage" />
				<form id="login-content" name="singin"
					action="<c:url value='/j_spring_security_check' />" method='POST'>
					<c:if test="${not empty error}">
						<div class="error">
							<c:if test="${pageContext.response.locale == 'en'}">
								
							${sessionScope["SPRING_SECURITY_LAST_EXCEPTION"].message}
						</c:if>
							<c:if test="${pageContext.response.locale == 'ru'}">

								<spring:message
									code="AbstractUserDetailsAuthenticationProvider.badCredentials" />

							</c:if>
						</div>
					</c:if>
					<div class="fields">
						<label for="login"><spring:message
								code="company.login.login" /></label>
					</div>
					<div>
						<input type="text" id="login" name="j_username"
							placeholder="<spring:message code="company.login.login" />"
							required>
					</div>
					<div id="login-error" class="error"></div>
					<div class="fields">
						<label for="password"><spring:message
								code="company.login.password" /></label>
					</div>
					<div>
						<input type="password" id="password" name="j_password"
							placeholder="<spring:message code="company.login.password" />"
							required>
					</div>
					<div id="password-error" class="error"></div>
					<br> <input name="submit" type="submit"
						value="<spring:message code="company.login" />" />
				</form>
			</div>

		</div>
		<div id="bodybottom">&nbsp;</div>
		<div id="footer">
			<%@ include file="/WEB-INF/jspf/footer.jspf"%>
		</div>
		<!-- end side menu -->
	</div>
	<!-- end wrapper -->

</body>
</html>